<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>3.左右浮动应用场景与盒边界</title>
  <style>
    div {
      width: 200px;
      height: 200px;
  
    }
    main {
      border: solid 3px black;
      height: 220px;
      width: 620px;
      margin: 0 auto;
      padding: 20px;

    }
  
    div:nth-of-type(1) {
      border: solid 1px red;
      float: left; 
    }
  
    div:nth-of-type(2) {
      background: blue;
      float: right;
  
    }
  </style>
  </head>
  
  <body>
    <main>
    <div></div>
    <div></div>
    </main>
  </body>
  
  </html>